![]() |
MPCreateSemaphore |
||||
Header: | Multiprocessing.h | Carbon status: | Supported | |
Creates a semaphore.
OSStatus MPCreateSemaphore ( MPSemaphoreCount maximumValue, MPSemaphoreCount initialValue, MPSemaphoreID *semaphore );
The maximum allowed value of the semaphore.
The initial value of the semaphore.
On return, semaphore contains the ID of the newly–created semaphore.
A result code.
If you want to create a binary semaphore, you can call the macro MPCreateBinarySemaphore (MPSemaphoreID *semaphore) instead, which simply calls MPCreateSemaphore with both maximumValue and initialValue set to 1.
Also see the function MPDeleteSemaphore.
Introduced with Multiprocessing Services 1.0.
Supported in Carbon. Available in CarbonLib 1.0 and later when MPLibrary 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by MPLibrary 1.0 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)